package com.cjzuji.rental.exception;

/**
 * @author bag
 * @version V1.0
 * @date 2025/6/16 16:15
 * @since 1.0
 */

public class BusinessException extends RuntimeException {
    private final String code; // 关联错误码

    public BusinessException(String code, String message) {
        super(message);
        this.code = code;
    }

    // 可扩展：传入枚举类（如ErrorCodeEnum）
    public BusinessException(ErrorCodeEnum errorCode) {
        super(errorCode.getMsg());
        this.code = errorCode.getCode();
    }

    public String getCode() { return code; }
}